import { assert, ethers, JsonRpcProvider } from "ethers";
import "../contracts/ContractAddress.js";
import fs from "fs";

import dotenv from "dotenv";
import { SEPOLIA_NET } from "../contracts/ContractAddress.js";
dotenv.config();
export async function mintUSDT(to, amount) {
  const provider = new JsonRpcProvider(
    "https://sepolia.infura.io/v3/e6d75cb9f0b14aba8c7069ebefb03bbc"
  );
  const contractAddress = SEPOLIA_NET.erc20; //  your nft address
  const abi = JSON.parse(
    fs.readFileSync("./contracts/abi/USDT.json").toString()
  );
  const contract = new ethers.Contract(contractAddress, abi, provider);
  const wallet = new ethers.Wallet(process.env.PRIVATE_KEY_SEPOLIA, provider);

  const tx = await contract
    .connect(wallet)
    .transfer(to, ethers.parseEther(amount.toString()));
  return tx;
}
// mintUSDT("0xC0877e04814e7aCC76d71F274F8ca187a9Bf11a9", 1);
